package introduce.explaining.variable;

/**
 * Created by Administrator on 2018/1/25.
 */
public class Test {

    private String platform;
    private String browser;
    private int resize;

    void test() {
        if ((platform.toUpperCase().indexOf("MAC") > -1) &&
                (browser.toUpperCase().indexOf("IE") > -1) &&
                wasInitialized() && resize > 0) {
            // do something
        } else {
            // do something
        }
    }

    private boolean wasInitialized() {
        return false;
    }


    final boolean isMacOs = platform.toUpperCase().indexOf("MAC") > -1;
    final boolean isIEBrowser = browser.toUpperCase().indexOf("IE") > -1;
    final boolean wasResized = resize > 0;

    void testRF() {
        if (isMacOs && isIEBrowser && wasInitialized() && wasResized) {
            // do something
        } else {
            // do something
        }
    }

}
